package com.newcapec.lesson2;

import java.util.Arrays;

public abstract class Person extends Object{
     public static int count = 0;
     private int objNumber;
     public abstract void eat();

     {
          this.objNumber = ++count;
     }

     public int getObjNumber() {
          return objNumber;
     }

     @Override
     protected void finalize() throws Throwable {
          System.out.println(this.objNumber+"号对象被回收");
          count--;

     }
}
